
package DBConnections;

/**
 *
 * @author aeguzkiza
 */

import DBConnections.MySQL_Query;
import java.sql.ResultSet;
import java.sql.SQLException;

public class DeviceData {
    // Loading libraries
    MySQL_Query DB = new MySQL_Query();

    private ResultSet rs;

    private String DeviceHost;
    private String DeviceAETitle;
    private String DevicePort;
    private String DeviceUID;
    private String TestUID;

    public DeviceData(Integer Id) throws SQLException{
        // SERVER DATA:
        rs = DB.SQLquery("SELECT * FROM device WHERE Id="+Id);
        rs.first();
        
        this.DeviceAETitle = rs.getString("AETitle");
        this.DeviceHost = rs.getString("DeviceIP");
        this.DevicePort = Integer.toString(rs.getInt("DevicePort"));

        this.DeviceUID = rs.getString("DeviceUID");
        this.TestUID = rs.getString("TestUID");

        //System.out.println("ServerHost: "+ServerHost+"\nServerAETitle: "+ServerAETitle+"\nServerPort: "+ServerPort+"\n");


    }       
    public String getAETitle(){
        return this.DeviceAETitle;
    }
    public String getHost(){
        return this.DeviceHost;
    }
    public String getPort(){
        return this.DevicePort;
    }
    public String getDeviceUID(){
        return this.DeviceUID;
    }
    public String getTestUID(){
        return this.TestUID;
    }
}
